﻿@model IEnumerable<Menu>

<div class="table-responsive-sm">
    <table class="table table-bordered table-hover dataTable" role="grid" aria-describedby="sample_2_info">
        <thead>
            <tr role="row">
                <th class="table-checkbox" style="width:40px;text-align:center;">
                    <input id="checkAll" class="group-checkable" type="checkbox">
                </th>
                <th tabindex="0" aria-label="">
                    功能名称
                </th>
                <th tabindex="0" aria-label="">
                    功能编码
                </th>
                <th tabindex="0" aria-label="">
                    路径
                </th>
                <th tabindex="0" aria-label="">
                    类型
                </th>
                <th tabindex="0" aria-label="">
                    功能描述
                </th>
                <th tabindex="0" style="width: 230px;" aria-label="">
                    操作
                </th>
            </tr>
        </thead>

        @if (Model.Any()) {
            <tbody id="tableBody">
                <!--内容放在tablerows中，通过js填充-->
            </tbody>
        }
    </table>
</div>

<!-- Edit Modal Form -->
<div id="menuEditModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            @await Html.PartialAsync("_Edit")
        </div>
    </div>
</div>

<!-- Add Modal Form -->
<div id="menuAddModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <!--form-->
            @await Html.PartialAsync("_Add")
        </div>
    </div>
</div>

<!-- Delete Modal Form -->
<div id="menuDeleteModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <form method="post" asp-controller="menu" asp-action="remove">
                <div class="modal-header">
                    <h4 class="modal-title">删除菜单和功能</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                </div>
                <div class="modal-body">
                    <p>确定删除该记录吗?</p>
                </div>
                <div class="modal-footer">
                    <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
                    <input type="submit" class="btn btn-danger" value="Delete">
                </div>
            </form>
        </div>
    </div>
</div>